home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / TSPA3260.ZIP / TSPAS.NWS < prev    next >
Text File  |  1993-02-24  |  33KB  |  626 lines

  1. News on the TSPAS package by Timo Salmi in reverse order
  2. ========================================================
  3.  
  4. University of Vaasa, Finland, Sun IPX SPARCstation garbo.uwasa.fi
  5. has a large collection of PD and shareware PC programs available by
  6. anonymous ftp and mail server. The file /pc/ts/0news-ts contains
  7. news about the TS-programs in the /pc/ts directory (in reverse
  8. order). This text, which you now have, is an extract from the
  9. 0news-ts file and the UseNet news.
  10. ..................................................................
  11. Prof. Timo Salmi      Co-moderator of comp.archives.msdos.announce
  12. Moderating at garbo.uwasa.fi anonymous FTP archives 128.214.87.1
  13. Faculty of Accounting & Industrial Management; University of Vaasa
  14. Internet: ts@uwasa.fi Bitnet: salmi@finfun   ; SF-65101, Finland
  15. ..................................................................
  16.  
  17. ┌────────────────────────────────────────────────────────────────┐
  18. │ Appeal: Let me take up a request for those of you who may have │
  19. │ found my programs or units useful.  As I am not asking for a   │
  20. │ registration fee for private versions, would you do me a       │
  21. │ reciprocal favor by uploading at least some of my packages to, │
  22. │ say eg one local bulletin board (BBS), and thus contribute to  │
  23. │ disseminating the *latest* versions of these packages.  And,   │
  24. │ if you distribute these packages, would you PLEASE distribute  │
  25. │ an entire package, not individual programs from within any     │
  26. │ package. This is a request that all of us share who write      │
  27. │ freeware and shareware programs.                               │
  28. └────────────────────────────────────────────────────────────────┘
  29.  
  30. Wed 24-Feb-93: I have updated my Turbo Pascal units collection. It
  31. is now garbo.uwasa.fi:/pc/ts/tspa32*.zip where * = 40,50,55,60,70.
  32.    I replaced CHIPFN "Get the type of the processor chip" with
  33. CPUFN. It should detect also a 486 while CHIPFN did not. My thanks
  34. to Duncan Murdoch for his help in this.
  35.    The new routines added are
  36.   ISEGAFN  Is at least an EGA present. No graph unit needed
  37.   NOLABEL  Delete a disk's volume label.
  38.   SCROLLDN Scroll down a window. No Crt unit needed
  39.   SCROLLUP Scroll up a window. No Crt unit needed
  40.   SETLABEL Set a disk's volume label.
  41.  
  42. Sat 23-Jan-93: As all Turbo Pascal users know to our common chagrin
  43. the different Turbo Pascal version TPUs are not compatible across
  44. the versions. I have made a Turbo Pascal 7.0 real mode compatible
  45. rendition of my Turbo Pascal units garbo.uwasa.fi:/pc/ts/
  46. tspa3170.zip.
  47.    Since some users may ask, I am not going to make protected mode
  48. nor TPW compatible versions. Protected mode programming has quirks
  49. of it own, and is thus specialized. As for TPW, I do not use Windows
  50. myself, and have thus no real interest of supporting it.
  51.   The other, non-updated versions are
  52.     garbo.uwasa.fi:/pc/ts/tspa3140.zip
  53.     garbo.uwasa.fi:/pc/ts/tspa3150.zip
  54.     garbo.uwasa.fi:/pc/ts/tspa3155.zip
  55.     garbo.uwasa.fi:/pc/ts/tspa3160.zip
  56.  
  57. Sun 8-Nov-92: I have again updated my Turbo Pascal units collection.
  58. It is now garbo.uwasa.fi:/pc/ts/tspa31*.zip where * = 40,50,55,60.
  59. The new routines added are
  60.  TSUNTB:
  61.    BBINFN   Convert decimal byte to binary string
  62.    BHEXFN   Convert decimal byte to hexadecimal string
  63.  TSUNTE:
  64.    ARCFILFN Is a file's archive bit set or not
  65.    HIDFILFN Is a file a hidden file or not
  66.    RDOFILFN Is a file a read-only file or not
  67.    SYSFILFN Is a file a system file or not
  68.  TSUNTG:
  69.    ACTDRVFN Which floppy drive is active on a one drive system
  70.    FLOPSTFN Floppy disk status. Is it present and formatted.
  71.    ISUBSTFN Is a drive a substituted drive (MsDos 3.1+)
  72.    MEDIAFN  What kind of a disk media is present in a drive
  73.               returns: $00 : Error
  74.                        $F0 : Floppy of 1.44Mb
  75.                        $F8 : Fixed disk
  76.                        $F9 : Floppy of 1.2Mb
  77.                        $FA : Floppy of 720Kb
  78.                        $FD : Floppy of 360Kb
  79.                        $FF : Floppy of 320Kb
  80.  TSUNTJ
  81.    ISDIR2FN Is a name a directory or not, alternative method
  82.  
  83. Sun 20-Sep-92: In my Turbo Pascal units there is a number of
  84. editable readln substitutes:
  85.  TSUNTF: (uses Dos, Crt)
  86.   EDRDLN   Readln with line-editing potential (the simplest)
  87.   EDREABLN Edreadln with ctrl-c and break trapping
  88.   EDREADLN Editable Readln with recall, and insert toggle
  89. I have written alternative versions of these routines which can take
  90. a PrefillString as the default input string, so the user has an
  91. option of just pressing enter, and default is selected.
  92.   EDRDEBLN Editable Readln with ctrl-c, break trapping, pre-fill etc
  93.   EDRDEFLN Editable Readln with recall, pre-fill, and insert toggle
  94. The suggestion to make this enhancement came from Darrell Davis
  95. davisd@ziavms.enmu.edu. My thanks to Darrell for his useful
  96. suggestion.
  97.  garbo.uwasa.fi:/pc/ts/tspa3040.zip
  98.  garbo.uwasa.fi:/pc/ts/tspa3050.zip
  99.  garbo.uwasa.fi:/pc/ts/tspa3055.zip
  100.  garbo.uwasa.fi:/pc/ts/tspa3060.zip
  101.  
  102. Wed 26-Aug-92: Updated my Turbo Pascal units collection. It is now
  103.  garbo.uwasa.fi:/pc/ts/tspa29*.zip
  104. where * = 40,50,55,60.
  105.    Bug fixed (hopefully) the ISDIRFN "Is a name a directory or not"
  106. function in TSUNTJ unit. My thanks are due to Richard (Ricki) Breuer
  107. ricki@rwthi3.informatik.rwth-aachen.de for alerting me to the
  108. problem.
  109.    In the process we noticed a rather undesirable feature of DRDOS.
  110. All my units are written for MsDos (command.com). The alternative
  111. command interpreters like DRDOS and 4DOS can cause incompatibilities
  112. since some of Turbo Pascal's routines (like IOResult) utilize the
  113. values the system returns. There is nothing I can do about
  114. incompatibilities like this, and it is a coincidence that we even
  115. noticed, since I do not run 4DOS or DRDOS. Anyway, ISDIRFN eill not
  116. work as expected if you are using DRDOS. I do not know about 4DOS.
  117.    SETENV "Set a parent environment variable (variable=value)" in
  118. the TSUNTENV unit now accepts cases like TARGET=A B C (formerly the
  119. it was cut at the spaces).  Also this suggestion is to to Ricki. Be
  120. careful.  Trailing white spaces and other invisible characters you
  121. might put in there are included. Thus "TARGET=A" and "TARGET=A " are
  122. not the same thing.
  123.    Started a new 4.0+ specific unit TSUNTK. It contains the
  124. following routines.
  125.   BOOTDRFN Get boot device name (MsDos 4.0+)
  126.   GETSERFN Get disk's serial number (MsDos 4.0+)
  127.   GETVOLFN Special get disk volume label (MsDos 4.0+)
  128.   SETSER   Set floppy's serial number (MsDos 4.0+)
  129. The first, that is BOOTDRFN was transferred from the TSUNTH unit.
  130. The others are brand new. I got the idea to get and set the disk
  131. serial number from PC-Magazine (July 1992, Vol. 11, No. 13, p. 496)
  132. which published TP 6.0 specific code for these tasks. Since my own
  133. TP units are more general, that is for all the current MsDos TP
  134. versions starting from TP 4.0, I decided to write routines of my own
  135. for these tasks. But the users interested in a source code may wish
  136. to look at the article.  (I did not bother to test whether the
  137. PC-Magazine code works, but I don't see why not). I got interested
  138. because I now use MsDos 5.0 in addition to 3.30 and 3.21 (and the
  139. aggravating 4.01).
  140.    Added HEXLNGFN "Convert hexadecimal string to decimal longint up
  141. to 7FFFFFFF" to the conversion unit TSUNTB because TSUNTK internally
  142. needs this conversion in accessing the disk serial number.
  143.    Added to TSUNTE the following elementary routines, just because I
  144. occasionally happen to need them myself.
  145.   LABELFN  Get a disk's volume label (not for TP 4.0)
  146.   DEFDRVFN Get the default drive
  147.    Finally added HIBACK to TSUNTC to enable high intensity
  148. background colors instead of enabling blinking text. The appropriate
  149. interrupt was pointed out by Robert Beauchaine bobb@vice.ICO.TEK.COM
  150. on the UseNet news in comp.lang.pascal. The routine requires an EGA,
  151. MCGA, or a VGA.
  152.  
  153. Sat 13-Jun-92: Updated my Turbo Pascal units collection. It is now
  154.  garbo.uwasa.fi:/pc/ts/tspa28*.zip
  155. where * = 40,50,55,60.
  156. Added to TSUNTG unit
  157.   GETESCAN Get scancode of key pressed, enhanced keyboard.
  158.   GETSCAN  Get scancode of key pressed, XT keyboard.
  159. The TSUNTENV unit already had
  160.   SETENV   Set a parent environment variable (variable=value).
  161. but this takes effect only after the program has been completed.
  162. Added an alternative which takes effect immediately, but is
  163. temporary
  164.   SETENVSH Set an environment variable for the duration of shelling.
  165. One of the handy uses of SETENVSH is that you can temporarily change
  166. the prompt to indicate that you are shelled out of a program so that
  167. you are less likely to forget to type exit. See TSUNTG.TST for how
  168. to use this feature.
  169.  
  170. Sat 8-Feb-92: I have updated my Turbo Pascal units collection to be
  171.  garbo.uwasa.fi:/pc/ts/tspa2740.zip
  172.  garbo.uwasa.fi:/pc/ts/tspa2750.zip
  173.  garbo.uwasa.fi:/pc/ts/tspa2755.zip
  174.  garbo.uwasa.fi:/pc/ts/tspa2760.zip
  175. This time I have introduced (parent) environment related routines in
  176. a new TSUNTENV.TPU unit
  177.   ENVSIZFN Get the size of the parent environment
  178.   ENVUSEFN Get the current use of the parent environment
  179.   ENVADDFN Get the starting segment address of the parent environment
  180.   SETENV   Set a parent environment variable (as MsDos SET var=value)
  181.   SHOWENV  Write the parent environment table on stdout (for testing)
  182. Setting a parent environment variable from within a Turbo Pascal
  183. program can be considered reasonably advanced programming I guess,
  184. and I cannot be absolutely sure that I got it right. But here goes
  185. anyway. The key to the task is obtaining the starting address of the
  186. parent environment, and knowing that the format of the parent
  187. environment table in memory is
  188.       name=value1<nul>name=value2<nul>...name=valueN<nul><nul>.
  189. PC Magazine Vol. 11, No. 1, pp. 425-427 has useful code which can be
  190. adapted to find out the relevant segment address. Should you look at
  191. that article, the crucial variable to get at in there is EnvSeg. The
  192. rest then follows. What a delightfully complicated challenge.
  193.    Oh yes, since I know that some users will be asking for the
  194. source code. I am happy to share this reference, and make my .TPU
  195. collection publicly available, but I have chosen not to distribute
  196. by source codes.
  197.    In fact I have not added the unit to the tspas2740.zip TP 4.0
  198. version TPUs, but I have updated it nevertheless to avoid confusion
  199. with the version numbers.
  200.  
  201. Mon 6-Jan-92: I have updated my Turbo Pascal units collection to be
  202.  garbo.uwasa.fi:/pc/ts/tspa2640.zip
  203.  garbo.uwasa.fi:/pc/ts/tspa2650.zip
  204.  garbo.uwasa.fi:/pc/ts/tspa2655.zip
  205.  garbo.uwasa.fi:/pc/ts/tspa2660.zip
  206. by transferring the following routines from TSUNTH.TPU unit to a new
  207. TSUNTJ.TPU unit
  208.   COPYFILE Copy a file from within a Turbo Pascal program
  209.   OPENEDFN Is an assigned textfile still open or not
  210.   ISDIRFN  Is a name a directory or not
  211.   PIPEDIFN Is the standard input from redirection
  212.   PIPEDNFN Is the standard output redirected to nul
  213.   PIPEDOFN Is the standard output redirected
  214. by adding the following routines to TSUNTJ.TPU
  215.   INTRADDR Show the memory address to which the interrupt points
  216.   INTRLOCA Show the memory address where the interrupt is located
  217. and by adding the following routines to TSUNTH.TPU
  218.   ISMOUSFN A simple true/true false test of mouse available
  219.   MOUSTAFN Status (type byte) of the mouse hardware and driver
  220. My thanks are due to Duncan Murdoch in particular who first noted a
  221. potential error in the early version of my mouse functions.
  222.    The first of the sets garbo.uwasa.fi:/pc/ts/tspa2640.zip contains
  223. a compatibility unit TSUNT45.TPU for Turbo Pascal 4.0. It adds
  224. routines that the later versions have, but which are missing in
  225. version 4.0. I have added
  226.   GetVerify Get the status of the MsDos write verify flag
  227.   SetVerify Set the status of the MsDos write verify flag
  228.   GetCBreak Get the state of Ctr-Break checking in DOS
  229.   SetCBreak Set the state of Ctr-Break checking in DOS
  230.  
  231. Sun 27-Oct-91: I have updated my Turbo Pascal units collection to be
  232.  garbo.uwasa.fi:/pc/ts/tspa2540.arc
  233.  garbo.uwasa.fi:/pc/ts/tspa2550.arc
  234.  garbo.uwasa.fi:/pc/ts/tspa2555.arc
  235.  garbo.uwasa.fi:/pc/ts/tspa2560.arc
  236. by adding the following routines
  237.   ISANSIFN Has ansi.sys a a similar driver been loaded
  238.   BTEWRDFN Combine two bytes into a single word, inverse of Hi & Lo
  239.   WRDLNGFN Combine two words into a longint
  240.   HIWORDFN The high-order (hi) word of the longint argument
  241.   LOWORDFN The low-order (lo) word of the longint argument
  242.  
  243. Sun 21-Jul-91: I have updated my Turbo Pascal units collection to be
  244. /pc/ts/tspa24##.arc (where ## = 40, 50, 55, and 60).
  245.    Turbo Pascal 5.0 (and later) introduced some routines which are
  246. not present in version 4.0. My Turbo Pascal units collection (the
  247. 4.0 version) includes a TSTPU45 unit which introduces some of the
  248. missing routines also to TP 4.0. I have added FExpand (Expand a file
  249. name into a fully qualified file name) to this unit.
  250.    Occasionally you will want to be able to tell where the standard
  251. input to your program comes from.  Does it come in the normal way
  252. from the keyboard, or does it come from redirection. Likewise, you
  253. may wish your program to know whether its standard output goes to
  254. the screen, or is it redirected to a file or through a pipe. The
  255. new boolean functions in the TSUNTH.TPU unit will give this
  256. information:
  257.   PIPEDIFN Is the standard input from redirection
  258.   PIPEDOFN Is the standard output redirected
  259.   PIPEDNFN Is the standard output redirected to nul
  260. Other new routines in the TSUNTH unit include:
  261.   BOOTDRFN Get boot device name (MsDos 4.0+)
  262.   DATEFMFN Country-dependent date format (MsDos 3.0+)
  263.   NRCYLFN  Number of cylinders on a drive if media present (MsDos 3.2+)
  264.   TIMEFMFN Country-dependent time format (MsDos 3.0+)
  265.   Z2ASZFN  Convert an Asciiz string into an ordinary ascii string
  266.  
  267. Tue 8-Jan-91: My Turbo Pascal units collection is now available also
  268. for Turbo Pascal 6.0. It is /pc/ts/tspa2360.arc, and is in no other
  269. way different from tspa2340.arc, tspa2350.arc, and tspa2355.arc
  270. except that the units are for 6.0. As you know, Turbo Pascal units
  271. are not compatible across versions.
  272.  
  273. Sat 5-Jan-91: I have upgraded my Turbo Pascal units collection at
  274. uwasa.fi archives by making several changes. Most importantly I have
  275. divided the package into three parallel packages:
  276.   tspa2340.arc  for Turbo Pascal 4.0 version
  277.   tspa2350.arc  for Turbo Pascal 5.0 version
  278.   tspa2355.arc  for Turbo Pascal 5.5 version
  279. Thus you'll only need the package concurring with the Turbo Pascal
  280. version you use yourself. With the exception of the differences
  281. inherent to the different releases of Turbo Pascal, the packages are
  282. the same.
  283.    I am expecting Turbo Pascal 6.0, but it has not arrived yet.
  284.    I have added a new unit TSERR.TPU which turn on the verbal
  285. run-time error messages. It is very easy to use. Just include
  286.  uses TSERR;
  287. at the beginning of your main program and you'll have verbal
  288. run-time error messages besides the original, cryptic error codes.
  289.    I have done some cleaning of the old units by omitting some of
  290. the older routines which have a more efficient later replacement. In
  291. particular this concerns the functions for converting values from
  292. one base to another.
  293.    There are also new routines:
  294.   PARSENFN Number of substrings in a string (resembles ParamCount)
  295.   PARSERFN Get substrings from a string (resembles ParamStr)
  296.   FATSFN   Get number of file allocation tables, not XTs
  297.   INTERLFN Get interleave coefficient of a harddisk, not XTs
  298.   LASTDRFN Get last drive of the system, softcoded, not XTs
  299. and the generic power function POWERGFN has been rewritten.
  300.  
  301. Wed 8-Aug-90: I have updated my Turbo Pascal (4.0, 5.0, 5.5) units
  302. collection to be version (/pc/ts/)tspas22.arc.
  303.    There are several functions which Tubro Pascal 5.0 and 5.5 have,
  304. but TP 4.0 does not.  I have added a new unit tsunt45.tpu which
  305. includes some of these functions such as EnvCount, EnvStr, GetEnv,
  306. and ParamStr0 (giving the name of the program).
  307.    The unit tsunti.tpu can be used to put information into the .exe
  308. file and perform selftests of the .exe.  This unit is now also
  309. available for TP 4.0.
  310.    Turbo Pascal ReadKey lacks the ability to read special keys such
  311. as RightShift, LeftShift, RightCtrl, and so on.  Functions to detect
  312. pressing these keys have been added.
  313.    Turbo Pascal ReadKey also lacks the ability to cope with the full
  314. enhanced keyboard potential. This means that TP ReadKey does not
  315. detect pressing F11 or F12, and that it cannot distinguish between
  316. the numeric keyboard cursor keys and the grey cursor keys. I have
  317. added a RDENKEFN function which has these abilities.
  318.  
  319. Wed 1-Aug-90: I have updated my Turbo Pascal (4.0, 5.0, 5.5) units
  320. collection to be version (/pc/ts/)tspas21.arc.
  321.    Turbo Pascal version 4.0 does not have the DosVersion function
  322. available in versions 5.0 and 5.5. I have written this function for
  323. version 4.0. Furthermore the lack of this function caused errors in
  324. TP 4.0 versions of my last two units.  This has been put right.
  325.    I have included a new unit (tsunti.tpu) for putting information
  326. into the .exe file, and retrieving the information (not for TP 4.0).
  327. The routines include a method for calculating the direct checksum
  328. for a file (eg for virus checking). This is not as trivial as it may
  329. sound at first sight, because in calculating the checksum, the
  330. checksum constant within the program must be skipped. (Else a change
  331. in the checksum constant would alter the checksum resulting in a
  332. "vicous circle"). Also, the method must be fast enough.
  333.    I have also included a fast a date and filesize checking method
  334. for detecting if the .exe has been pacthed or its size altered. (Of
  335. course, the checksum method is much more difficult to defeat, but it
  336. is more complicated and not as fast). Here I have made an exception
  337. and included the source code. It is in the selftest.pas file within
  338. tspas21.arc.
  339.  
  340. Mon 23-Jul-90: I have updated my Turbo Pascal (4.0, 5.0, 5.5) units
  341. collection to be version (/pc/ts/)tspas20.arc.
  342.    One problem area that has intrigued me for some time is finding a
  343. technique for storing information within an executable file and
  344. updating that information. I've looked into it and written a couple
  345. of relevant procedures. USECOUNT keeps track of how many times the
  346. program has been run and stores the result within the .exe file.
  347. BRANDEXE is a more general, but also a more complicated procedure
  348. for .exe file handling. As an example I have a demonstration how to
  349. tell the previous time when the program was run.
  350.    The function checking the on-line status of the printer
  351. (prnonlfn) has been rewritten to work without Turbo Pascal's Crt
  352. unit. And an alternative printer on-line status function, LTPONLFN,
  353. has been added. This one should be more robust, because it actually
  354. tries to send a carriage return to the printer, and observes the
  355. resultant success of the operation to define the on-line status. Of
  356. course this is achieved by {$I-} {$I+} IOResult testing, but the
  357. real trick here is make to system respond immediately rather than in
  358. the default response time of up to one minute. A new procedure
  359. PRTSCR sends the current screen to the printer. The new routines
  360. GETPRTFN and SETPRT get and set respectively the number of printer
  361. default retry times before a timeout.
  362.    TICKSFN is a simple complement to the TIMERFN already in the
  363. collection. TICKSFN gives the number of clock ticks (there are 18.2
  364. per second) since midnight.
  365.    A new LASTDMFN returns the number of days in a given month and
  366. year. DATEOKFN tells whether a date is a valid, existing date.
  367. ZELLERFN lets you compare which of the two dates is earlier,
  368. calculate the number of days between two dates etc.
  369.    A new FIXEDFN returns whether a drive is a fixed disk or not.
  370. MATHCOFN returns if a math coprocessor is present. RS232FN returns
  371. the number of serial ports. PARPORFN returns the number of parallel
  372. ports. COUNTRFN returns the country code. CHIPFN returns the type of
  373. the processor chip.
  374.    There are new keyboard routines. SCRLONFN gets the current
  375. ScrollLock status. CAPS, NUMLOCK, and SCRLOCK respectively set the
  376. CapsLock, NumLock and ScrollLock on, or off. They take the desired
  377. status as a boolean argument.
  378.   CLS sets 25*80 text mode and clears the screen and CLS40 does
  379. likewise for 25*40. Crt is not required.
  380.    So far none of the routines in the TSPAS collection have included
  381. any inline code. Starting from tspas20.arc this no longer holds. I
  382. have tried to understand some assembler and have included also
  383. inline code. Be warned that I cannot give any guarantees that the
  384. inline coded routines won't cause confusion.  Where inline code has
  385. been used, I have stated so. The first function to utilize this is
  386. LOWCASFN which is the exact opposite of Turbo Pascal's own UpCase
  387. function.
  388.    WARMBOOT simulating alt-clr-del, and COLDBOOT reboot with memory
  389. tests are new, inline routines.
  390.    A couple of routines have been moved from one unit to another.
  391.  
  392. Newsgroups: comp.lang.pascal
  393. From: ts@chyde.uwasa.fi (Timo Salmi)
  394. Subject: Redirecting writes to the printer
  395. Organization: University of Vaasa
  396. Date: Sun, 22 Jul 90 03:58:00 GMT
  397. (*
  398. About half a year ago several posters wanted to find a way to direct
  399. all output to the printer. (To enable a documentation of students'
  400. programming tasks.) For some reason nobody of us then found a simple
  401. working solution, which is outrageously elementary, after fact.
  402. There are, of course, alternative solutions, the most complicated
  403. being writing a new device driver. An intermediate (easier) solution
  404. is to juggle with certain TP predefined constants. I have two
  405. procedures USECON and USEPRN (in /pc/ts/tspas19.arc tpu collection)
  406. which when placed anywhere within the program will change the output
  407. device. But below is an example the the easiest alternative needing
  408. no accessories.
  409. *)
  410. program HowToRedirectAllOutputEasilyToThePrinter;
  411. {$DEFINE printit}
  412. begin
  413.   {$IFDEF printit}
  414.   assign (output, 'prn');
  415.   rewrite (output);
  416.   {$ENDIF}
  417.   :
  418.   writeln ('From Timo Salmi: Hello world, and whatever else');
  419.   :
  420.   {$IFDEF printit}
  421.   close (output);
  422.   {$ENDIF}
  423. end.  (* thus endeth the escapade *)
  424.  
  425. Thu 14-Jun-90: I have updated my Turbo Pascal (4.0, 5.0, 5.5) units
  426. collection to be version (/pc/ts/)tspas19.arc. The function INDRIVFN
  427. in tsuntg.tpu tests whether a device is present in a drive. If you
  428. defined an invalid drive (such as '1'), a run time error occurred in
  429. my earlier versions. - Tsunta.tpu has a new function HIGHTFN, which
  430. gives the height of the screen by resolution (25, 43 or 50). -
  431. Tsuntf.tpu has a third enhanced readln with line editing, recall,
  432. insert toggle, and clean break potential. - Tsunth.tpu includes a
  433. new function ISDIRFNto test whether a name is a directory. -
  434. COPYFILE procedure copies a file from within a Turbo Pascal program
  435. and returns a success status code. I have seen postings in the
  436. (InterNet) news about problems with copying files in Turbo Pascal,
  437. but I hope that this one should do the trick. - OPENEDFN function
  438. indicates whether a text file has already been closed within the
  439. program, or if it is still open. This is particularly convenient for
  440. procedures aborting your program. - Tsuntd includes a new procedure
  441. called AUDIO. It is an enhanced version of Turbo Pascal's own sound
  442. procedure. It takes frequency and duration as parameters, and it
  443. does not need the presence of the interfering Crt unit. Audio was
  444. written in collaboration with Ari Hovila (ajh@chyde.uwasa.fi). - And
  445. since I am often asked the question, sorry, no, dear fellow users,
  446. the sources are not available, only the units and their documented
  447. interfaces.
  448.  
  449. Sun 25-Feb-90: I have gotten repeated requests from the users for a
  450. Turbo Pascal 5.5 version of my Turbo Pascal units collection. I now
  451. have finally got the 5.5 compiler, courtesy of University of Vaasa,
  452. because it was felt here that this international interaction is
  453. important enough to warrant the expense. (As I have told many of the
  454. users who have contacted me in this matter, I am not yet interested
  455. in OOP myself). Hence I am in a position to oblige. The new version
  456. is called tspas18.arc. There is only one new function in the
  457. collection this time. The main point was providing the TP 5.5
  458. versions of the units. Thus there are now three versions of each
  459. unit in this new release: TP 4.0, 5.5, and 5.5. - It is true that
  460. Borland has made excellent products for the PC community, but the
  461. incompatibility between the TPUs of the different Turbo Pascal
  462. versions has many of us users disgruntled.
  463.  
  464. Wed 6-Dec-89: Updated the Turbo Pascal 5.0 (and 4.0) units
  465. collection to be version /pc/ts/tspas17. The new procedures include
  466. WHEREXFN and WHEREYFN which locate the cursor position without the
  467. Crt unit. As you will recall Crt unit includes a WhereX and a WhereY
  468. function. The reason I have prepared alternatives to Crt functions
  469. and procedures in this, and the earlier releases, is because with
  470. some incompatible PCs the Crt unit causes problems, and redirection
  471. requires special measures with the Crt. - KEYPREFN is a replacement
  472. of KeyPressed and READKEFN for ReadKey. - CLUSIZFN gives the cluster
  473. size on a device. ALLSIZFN gives the true total size allocated to a
  474. file instead of the size shown on ordinary directory listings. -
  475. INKEYFN is a Basic-like timed input.
  476.  
  477. Tue 28-Nov-89: Some time ago there was a lively discussion in the
  478. InterNet news group comp.lang.pascal how to redirect all write and
  479. writeln statements to the printer without having to change the
  480. statements. I now have a solution to that problem for Turbo Pascal
  481. 4.0 and 5.0. The procedures USEPRN and USECON are part of update
  482. /pc/ts/tspas16.arc of my Turbo Pascal 5.0 and 4.0 units collection.
  483. The new procedures/functions also include WEEKNRFN function in the
  484. TSUNTE unit. It gives the weeknumber for a given date. REVCOLOR in
  485. TSUNTC reverses (toggles) text colors. And there are many other new
  486. routines making up a new unit TSUNTG.
  487.  
  488. Thu 26-Oct-89: I have a private mailing list for emailing these
  489. update news. Especially, if you have my programs downloadable at
  490. your site or your BBS you are welcome to ask for inclusion on this
  491. list.
  492.  
  493. Wed 18-Oct-89: Released update /pc/ts/tspas15.arc of my Turbo Pascal
  494. 5.0 and 4.0 units collection. New procedures/functions include BINFN
  495. in TSUNTB for fast conversion of decimal words to binary and HEXFN
  496. for fast conversion to hexadecimal. LBIN and LHEX convert long
  497. integers fast to binary and hexadecimal respectively. POWERLFN
  498. raises a longint to a power, fast. BORDER in TSUNTE changes the
  499. border color for CGA or VGA. All the rest of the procedures and
  500. functions remain unchanged.
  501.  
  502. Tue 26-Sep-89: Released update /pc/ts/tspas14.arc of the Turbo
  503. Pascal 5.0 and 4.0 units collection. The package contains units from
  504. tsunta.tpu to tsuntf.tpu. Tsunte.tpu contains a new function
  505. cmdlnfn, which gives the entire command line in a program call. The
  506. input line-editing procedure edreadln in tsuntf.tpu now has a recall
  507. option (CursorUp) and the insert key toggle. I have preserved an
  508. edrdln procedure for line-editing without recall and insert. Tsuntd
  509. has new ParamCount and ParamStr like functions for obtaining
  510. substrings from a string.
  511.  
  512. Sat 19-Aug-89: Released update /pc/ts/tspas13.arc of my Turbo Pascal
  513. units.  I have rewritten the cursor-size routines in a more general
  514. fashion and rearranged the units. 
  515.    One of the weaknesses of the readln statement in (Turbo) Pascal
  516. is that it does not allow editing the input-string while giving the
  517. input from the keyboard.  I decided to do something about this, and
  518. wrote an edreadln procedure, which allows to use of LeftCursor,
  519. RightCursor, BackSpace, Del, Home, End, and Esc.  Of course such
  520. routines are very common in input from popup windows.  Edreadln is,
  521. however, more of a readln-type procedure with normal scrolling
  522. capabilities, than a fixed position window routine.  This routine is
  523. included in the new release. 
  524.  
  525. Wed 2-Aug-89: I have released un updated version of the Turbo Pascal
  526. units collection tspas12.arc.  There are new string routines and
  527. detection of the monitor (mono/color) type.
  528.  
  529.  
  530. =======================================================================
  531.                   Messages from UseNet news
  532. =======================================================================
  533.  
  534. From ts Sat Jul 28 09:25:43 1990
  535. Subject: Re: Program selftesting and viruses
  536. To: 16012_3045@uwovax.uwo.ca (Paul Gomme)
  537. Date: Sat, 28 Jul 90 9:25:43 EET DST
  538. In-Reply-To: <0649102756@uwovax.uwo.ca>; from "Paul Gomme" at Jul 27, 90 6:19 pm
  539. X-Mailer: ELM [version 2.2 PL16]
  540. Status: OR
  541.  
  542. > >     Programmers: Help fighting viruses and patching.
  543. > >
  544. > >Viruses and unauthorized patching are problems which should be
  545. > >fought against by the PC community. This program demonstrates a
  546. > >simple and a reasonably general, fast selftest to detect whether the
  547. > >program has caught a virus, or if it has been amateurishly patched.
  548. > >The code is easily incorporated in any Turbo Pascal source code. The
  549. > >idea is to check whether the file date and size have been altered.
  550. > >Most .exe viruses work by appending their code to the .exe file
  551. > >altering the file size. Trivial patching changes the file date.
  552. > >Either of these is detected by selftest.
  553. > While the idea may have some merits, the execution is flawed.
  554.                                                         ^^^^^^
  555. No Paul, not flawed.  Rather not foolproof, nor is meant to be. 
  556.  
  557. > First, it is a minor matter to obtain the creation date of a file. 
  558. > Consequently, it is a relatively simple matter to apply a patch
  559. > which doesn't alter the file size, and restore the original creation
  560. > date.  Your technique is subject to such an "attack". 
  561.  
  562. Certainly.  The whole philosophy behind is to have a simple method
  563. which staves off any crude attempts.  The problem with the more
  564. elaborate selfchecks (such as embedded checksums) is that they are
  565. difficult to implement. 
  566.  
  567. > Second, there are often good reasons to patch a file.  Some of these
  568. > reasons are cosmetic in nature.  Some programs even encourage user
  569. > patching. 
  570.  
  571. Also true, and then such patching should take care of the date.  Or
  572. the selftest should have a relevant modification or omission of the
  573. date test. 
  574.  
  575. > From a more philosophical point of view, I wonder if protection
  576. > schemes don't in part encourage those who write viruses.  Surely
  577. > part of the "thrill" is to avoid detection. 
  578.  
  579. Maybe.  It can be looked at as a kind of a game.  Nevertheless,
  580. consider the popularity eg McAfee's virus control programs have
  581. gained.  Throwing one's hands up in the air is not a good solution. 
  582.  
  583. All the best, Timo
  584.  
  585. =======================================================================
  586.  
  587. From ts Tue Jul 31 12:07:13 1990
  588. Return-Path: <ts>
  589. Received: by uwasa.fi (4.1/(hh)29May89)
  590.     id AA08907; Tue, 31 Jul 90 12:07:12 +0300
  591. From: Timo Salmi LASK <ts>
  592. Message-Id: <9007310907.AA08907@uwasa.fi>
  593. Subject: selftest
  594. To: ts (Timo Salmi LASK)
  595. Date: Tue, 31 Jul 90 12:07:11 EET DST
  596. X-Mailer: ELM [version 2.2 PL16]
  597. Status: O
  598.  
  599. Newsgroups: comp.lang.pascal
  600. Path: uwasa.fi!ts
  601. From: ts@uwasa.fi (Timo Salmi LASK)
  602. Subject: Re: Program selftesting and viruses
  603. Message-ID: <1990Jul31.085732.8728@uwasa.fi>
  604. Organization: University of Vaasa
  605. References: <1990Jul27.182520.12051@uwasa.fi> <1875@krafla.rhi.hi.is>
  606. Date: Tue, 31 Jul 90 08:57:32 GMT
  607.  
  608. In article <1875@krafla.rhi.hi.is> frisk@rhi.hi.is (Fridrik Skulason) writes:
  609. >This program works in most cases - however, it is not effective against some
  610. >of the latest viruses, which fool it by making the program appear unchanged,
  611. >after the virus is in control.
  612.  
  613. This is certainly true, and the purpose of the code is to easily
  614. weed out elementary cases, which are the most frequent anyway.  One
  615. of the points was to make the code simple to understand and include. 
  616. The other alternative is to imbed a checksum in the .exe file.  But
  617. the code is much more complicated, because the checksum (either
  618. direct or crc) constant itself within the program must be skipped
  619. when recalculating the checksum.  Another problem is that the
  620. checksum must be calculated fast.  Else it renders the host program
  621. useless.  I have the code also for calculating and checking the
  622. direct checksum of an .exe file in addition to size & date check. 
  623. This should be fairly effective.  This will be included in the
  624. upcoming update of my Turbo Pascal units tspas21.arc. 
  625.